from wushi.web import webServer
from wushi.gui import easyui
from wushi.gui.matplot import showFunc, show_quadratic_example
from wushi.gui.quadratic import plot_quadratic, plot_quadratic2

def main():
    print("选择要显示的图形:")
    print("1. 正弦和余弦函数")
    print("2. 二次方程示例 (y = x² - 2x - 3)")
    print("3. 自定义二次方程")
    
    choice = input("请输入选项 (1/2/3): ")
    
    if choice == "1":
        showFunc()
    elif choice == "2":
        show_quadratic_example()
    elif choice == "3":
        print("输入二次方程 y = ax² + bx + c 的系数:")
        try:
            a = float(input("a = "))
            b = float(input("b = "))
            c = float(input("c = "))
            a2 = float(input("a2 = "))
            b2 = float(input("b2 = "))
            c2 = float(input("c2 = "))
            plot_quadratic2(a, b, c, a2,b2,c2)
        except ValueError:
            print("输入无效，请输入数字。")
    else:
        print("无效选项")


if __name__ == "__main__":   
    main()

    # matplot.showFunc()
    
    # easyui.showImage()
    
    # easyui.showMsgBox("my window", "Hello from module-learning!", "Let's go")
    # easyui.smallGame()
    # webServer.start(80)
